package com.example.cloud.springcloudvault.entity;

/**
 * 响应结果vo
 *
 * @param <T>
 */
public class ResponseResultVo<T> {
    /**
     * 数据对象
     */
    private T body;

    private T footer;

    /**
     * 查询的数据总记录数
     */
    private Integer total = 0;

    // true-成功；false-失败
    private boolean status = true;
    //    状态码
    private String statusCode = "200";

    // 信息
    private String msg = "响应成功";

    public ResponseResultVo() {
    }

    public ResponseResultVo(T body, boolean status, String msg) {
        this.body = body;
        this.status = status;
        this.msg = msg;
    }

    public void setResult(T body, boolean status, String msg) {
        this.body = body;
        this.status = status;
        this.msg = msg;
    }


    public ResponseResultVo(boolean status, String statusCode, String msg) {
        this.status = status;
        this.statusCode = statusCode;
        this.msg = msg;
    }

    public void setResult(boolean status, String statusCode, String msg) {
        this.status = status;
        this.statusCode = statusCode;
        this.msg = msg;
    }

    public ResponseResultVo(T body, boolean status, String statusCode, String msg) {
        this.body = body;
        this.status = status;
        this.statusCode = statusCode;
        this.msg = msg;
    }

    public ResponseResultVo(boolean status, String msg) {
        this.status = status;
        this.msg = msg;
    }

    public void setResult(boolean status, String msg) {
        this.status = status;
        this.msg = msg;
    }

    public ResponseResultVo(T body, Integer total, T footer) {
        this.body = body;
        this.total = total;
        this.footer = footer;
    }

    /**
     * 获取数据对象
     *
     * @return body 数据对象
     */
    public T getBody() {
        return body;
    }

    /**
     * 设置数据对象
     *
     * @param body 数据对象
     */
    public void setBody(T body) {
        this.body = body;
    }

    /**
     * 获取查询的数据总记录数
     *
     * @return total 查询的数据总记录数
     */
    public Integer getTotal() {
        return total;
    }

    /**
     * 设置查询的数据总记录数
     *
     * @param total 查询的数据总记录数
     */
    public void setTotal(Integer total) {
        this.total = total;
    }

    /**
     * 获取footer
     *
     * @return footer footer
     */
    public T getFooter() {
        return footer;
    }

    /**
     * 设置footer
     *
     * @param footer footer
     */
    public void setFooter(T footer) {
        this.footer = footer;
    }

    public boolean getStatus() {
        return status;
    }

    public void setStatus(boolean status) {
        this.status = status;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public boolean isStatus() {
        return status;
    }

    public String getStatusCode() {
        return statusCode;
    }

    public void setStatusCode(String statusCode) {
        this.statusCode = statusCode;
    }

    @Override
    public String toString() {
        return "ResponseResultVo{" +
                "body=" + body +
                ", footer=" + footer +
                ", total=" + total +
                ", status=" + status +
                ", statusCode='" + statusCode + '\'' +
                ", msg='" + msg + '\'' +
                '}';
    }
}
